﻿using Kevin.Shop.Business.Core.Components.Responser;
using Kevin.Shop.Business.Service.Entity.Helper;
using Kevin.Shop.Business.Service.Entity.SalesManagement.YinxinPay;
using RiderShop.Mobile.Common.Component;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RiderShop.Mobile.Modle.Purchase
{
    public class YinxinModel
    {
        /// <summary>
        ///  修改鲜享卡 | 联名卡 |  银信商通卡密码
        /// </summary>
        /// <param name="cardNumber">卡号</param>
        /// <param name="oldPassword">老密码</param>
        /// <param name="newPassword">新密码</param>
        /// <returns></returns>
        public static ServiceResponser ModifyYinxinPassword(string cardNumber, string oldPassword, string newPassword)
        {
            var yinxinPay = new YinxinPayEntity();
            yinxinPay.CardNumber = cardNumber;
            yinxinPay.OldPassword = oldPassword;
            yinxinPay.NewPassword = newPassword;
            yinxinPay.UserId = WebClientContext.Current.UserId;

            var response = RestfulHelper.Update(SiteUrl.FormatUrl("SalesManagement_YinxinModifyPassword"), yinxinPay);

            return response;
        }
    }
}
